package cn.com.czpb.client.module.personal.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import cn.com.czpb.client.R;
import cn.com.czpb.client.model.usercenter.LevelBean;

import java.util.List;

/**
 * Created by Administrator on 2017/8/14.
 */

public class LevelAdapter extends BaseMultiItemQuickAdapter<LevelBean.CreditruleEntity,BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public LevelAdapter(List<LevelBean.CreditruleEntity> data) {
        super(data);
        addItemType(0, R.layout.item_level);
    }

    @Override
    protected void convert(BaseViewHolder helper, LevelBean.CreditruleEntity item) {
        switch (helper.getItemViewType()){
            case 0:
                helper.setText(R.id.tv_1_level,item.getRulename());
                helper.setText(R.id.tv_2_level,"+"+item.getAddscore()+"分");
                helper.setText(R.id.tv_3_level,"上限"+item.getToplimit()+"分");
                break;
        }
    }
}
